<script>
    //189000503  左香菊
    //1
    let a1, b1, c1 = [1, 2, 3, ];
    console.log(a1, b1, c1);    //undefined undefined [1,2,3]

    let [a2, b2, c2] = [1, 2, 3, ];
    console.log(a2, b2, c2);    //1 2 3

    let a3, b3, c3 = [1, , 3, ];
    console.log(a3, b3, c3);    //undefined undefined [1,空,3]

    let [a4, b4] = [1];
    console.log(a4, b4);    //1 undefined

    let {y:a5, b5} = {x:1, y:2};
    console.log(a5, b5);    //2 undefined

    let {a6, b6} = 123;
    console.log(a6, b6);    //undefined undefined


    //2
    let set = new Set();
    set.add(1);
    set.add(2);
    set.add(3);
    set.delete(2);

    let i = set.values();
    console.log(i.next());  //{vulue: 1, done: false}
    console.log(i.next());  //{vulue: 3, done: false}
    console.log(i.next());  //{vulue: undefined, done: true}


    //3
    let map = new Map();
    map.set(1, "a");
    map.set(2, "b");
    map.set(3, "c");
    map.set(4, "d");

    for (let i=1; i <= map.size; i++) {
        console.log(map.get(i));    //a(换行)b(换行)c(换行)d(换行)
    }

    map.forEach(function(values, key) {
        console.log(values);    //a(换行)b(换行)c(换行)d(换行)
    });

    for(let v of map.values()){
        console.log(v);     //a(换行)b(换行)c(换行)d(换行)
    }

    for(var prop in map){
        console.log(prop);  //
    }


    //4
    let arr1 = [1,2,3];
    let arr2 = arr1;
    console.log(arr1==arr2);    //true

    let arr3 = [...arr1];   //  ...扩展运算符，将一个数组转为用逗号分隔的参数序列
    console.log(arr1==arr3);    //false


    //5用箭头函数改写代码
    let arr4 = [1, 2, 3];
    arr4.forEach(function(v,k) {
        console.log(v);
    })
    //改写
    let arr5 = [1, 2, 3];
    arr4.forEach((v,k) => {console.log(v);})


    //6
    Array.of(1, 2, 3).filter(i => i > 1).forEach(i => console.log(i));  //2(换行)3(换行)
    let fib = n => n > 1 ? fib(n - 1) + fib(n -2) : n;  //2(换行)3(换行)


    //7
    class Anmial{
        constructor(name){
            this.name = name;
        }
        shount(){
            console.log("汪汪汪");
        }

    }
    class Dog extends Anmial{
        constructor(age) {zz
            super(name);    // 调用父类的constructor(name),子类的构造函数中，只有调用 super 之后，才可以使用 this 关键字，否则会报错。
            this.age = age; 
        }
        eat(){
                console.log("吃狗粮")
            } 
    }
    let dog = new Dog("狗");
    dog.shount();   //汪汪汪
    dog.eat();  //吃狗粮
</script>